<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>办公管理系统-添加用户</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="Cache-Control" content="no-cache, must-revalidate"/>
    <meta name="Keywords" content="keyword1,keyword2,keyword3"/>
    <meta name="Description" content="网页信息的描述"/>
    <meta name="Author" content="fkjava.org"/>
    <meta name="Copyright" content="All Rights Reserved."/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/easyUI/easyui.css">

</head>
<body style="background: #F5FAFA;">
    <form id="updateSystemForm" method="post" style="margin:20px auto 0;width:80%">
        <!-- 当前用户的useId -->
        <input name="systemId" id="systemId" value="${systemParam.sysid}" type="hidden">
        <table class="table-condensed" style="width: 100%;table-layout: fixed;">
            <tbody>
            <tr>
                <td width="90"><label>参数名称:</label></td>
                <td><span class="label label-danger">${systemParam.paramName }</span></td>

            </tr>
            <tr>
                <td><label>参数值:</label></td>
                <td><textarea style="width: 100%;font-size: 12px;"  id="paramValue" name="paramValue" cols="30" rows="5" placeholder="请输入参数值">${systemParam.paramValue }</textarea></td>
            </tr>       
            </tbody>
        </table>
        <div align="center" style="margin-top: 20px;">
            <a id="btn_submit" class="btn btn-info"><span class="glyphicon glyphicon-edit"></span>&nbsp;修改</a>
        </div>
    </form>
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/jquery/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/jquery/jquery-migrate-1.2.1.min.js"></script>
<!-- 导入bootStrap的库 -->
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/easyUI/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/easyUI/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/plugins/layer/2.4/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/plugins/layer/2.4/LayConstant.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/md5.js"></script>

<script type="text/javascript">

    //修改
    $("#btn_submit").click(function () {

        var systemId = $("#systemId").val();

        var paramValue = $("#paramValue").val();
        if ($.trim(paramValue) == "") {
            layer.msg("请输入参数值!", {icon: 5, time: LayUIConstant.TIP_TIME});
            $("#paramValue").focus();
            return;
        }      

        $.ajax({
            url: '${pageContext.request.contextPath}/systemParam/updateSystem.jspx',
            data: {"systemId":systemId,"paramValue":paramValue},
            type: 'post',
            typeType: 'json',
            success: function (data) {
                if (data.code == 0) {
                    layer.msg(data.message, {icon: 1, time: LayUIConstant.TIP_TIME});
                    setTimeout(function () {
                        parent.location.reload();
                    }, 1500);
                } else {
                    layer.msg(data.message, {icon: 5, time: LayUIConstant.TIP_TIME});
                }
            },
            error: function (data) {
                layer.msg(data.message, {icon: 5, time: LayUIConstant.TIP_TIME});
            }
        });
    });


</script>


</body>
</html>
